package com.ftg.learn.util;


import java.util.List;

/**
 * 分页功能封装类
 *
 * @author 布衣
 */
public class PageEx<T> {
    private Integer page;
    private Integer size;
    private Integer count;
    private Integer totalPage;
    private List<T> rows;

    public PageEx(Integer page, Integer size) {
        this.page = page;
        this.size = size;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getTotalPage() {
        return this.getCount() % this.getSize() == 0 ? this.getCount() / this.getSize() : this.getCount() / this.getSize() + 1;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }
}
